import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class RedisDemo {


    public static final JedisPool jedisPool = new JedisPool("tcp://127.0.0.1:8888");

    //String
    static void test01(Jedis jedis) {
        //情况数据库
        jedis.flushAll();

        jedis.set("key1", "value1");
        jedis.set("key2", "value2");
        jedis.set("key3", "value3");

        String key1 = jedis.get("key1");
        System.out.println(key1);

    }

    public static void main(String[] args) {
        try(Jedis jedis = jedisPool.getResource()) {
            test01(jedis);
        }
    }
}
